package com.tju.backend.plugin.common;


import com.tju.backend.dao.ware.*;
import com.tju.backend.entity.TStereoscopicWarehouse;
import com.tju.backend.utils.hex.HexStringUtil;
import com.tju.backend.utils.redis.RedisService;
import com.tju.backend.utils.spring.SpringUtil;
import com.tju.backend.utils.tool.ChineseExceptionUtils;
import org.springframework.core.env.Environment;


/**
 * 全局方法调用类
 *
 * @USER: CLS
 */
public class GlobalCall {
    //redis
    public static final RedisService redisService = SpringUtil.getBean(RedisService.class);
    public static final ChineseExceptionUtils zhCh = SpringUtil.getBean(ChineseExceptionUtils.class);
    public static final StereoscopicWarehouseMapper sw = SpringUtil.getBean(StereoscopicWarehouseMapper.class);
    public static final ProductMapper pr = SpringUtil.getBean(ProductMapper.class);
    public static final WarehousingMapper warehousingMapper = SpringUtil.getBean(WarehousingMapper.class);
    public static final WarehouseMapper war = SpringUtil.getBean(WarehouseMapper.class);
    public static final OutWarehouseLogMapper outsw = SpringUtil.getBean(OutWarehouseLogMapper.class);
    public static final String[] productNameCount={"茶花强力粘勾","茶花洗衣袋","茶花马桶刷","茶花衣架","茶花脸盆","茶花马桶疏通器","茶花漱口杯 刷牙杯","茶花油壶","茶花地刷","茶花衣架、衣夹","茶花塑料洗脚盆","茶花一次性纸杯","茶花拖把墩布","茶花鞋刷","茶花垃圾桶"};
    public static final String[] productCodingCount={"951073","865209","953337","214624","214591","2003202","214626","951883","987456","959953","978973","741258","4110369","865223","3635748"};
    public static final String[] productSpecificationCount={"1个","4个","1个","1个","6只","1个","1个","1个","1个","1个","24个/篮","40只装","一个","一个","一个"};
    public static final String[] productBrandCount={"茶花（CHAHUA）"};
    public static final String[] productColourCount={"绿色","白色","白色","蓝色","灰色","米白色","绿色","蓝白色 白蓝色","咖色、灰色","浅粉","红色、黄色、蓝色","棕色","粉色、绿色","蓝色、粉色、灰色","棕色"};
    public static final String[] productTextureCount={"玻璃","PP塑料","涤纶","PP塑料","PP塑料","PP塑料","PP/PVC","PP塑料","PP/钢管","PP塑料","PP/合金","原生木浆纸","PA6/PP/涤纶/Q195","PP塑料","PP塑料"};
    public static Boolean result =true;
    /**
     * 任务占用
     */
    public static final Integer taskOccupy = 1 ; //任务占用
    /**
     * 任务空余
     */
    public static final Integer taskFree = 0 ; //任务空余
    /**
     * 任务空余
     */
    public static final Integer taskWarehousing = 2 ; //任务入仓

    //拼接内容
    public static String str(TStereoscopicWarehouse sw) {
        String grid = "";
        if (sw.getSterGrid().equals("0")) {
            grid = "01";
        } else if (sw.getSterGrid().equals("1")) {
            grid = "02";
        }
        String storehouse;
        if (sw.getStatus().equals(3L)) {
            storehouse = "02";
        } else {
            storehouse = "01";
        }
        return "0" + sw.getSterArea() + HexStringUtil.Hex(String.valueOf(sw.getSterFloor())) + HexStringUtil.Hex(String.valueOf(sw.getSterPosition())) + grid + storehouse;
    }
}
